﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DddCms.Models.UIComponent.Accordion
{
    public class AccordionViewModelBuilder
    {
        public AccordionViewModel AccordionViewModel { get; set; }

        public AccordionViewModelBuilder()
        {
            AccordionViewModel = new AccordionViewModel();
        }
        public AccordionViewModelBuilder Height(int height)
        {
            AccordionViewModel.Height = height; 
            return this;
        }

        public AccordionViewModelBuilder ID(string ID)
        {
            AccordionViewModel.ID = ID;
            return this;
        }

        public AccordionViewModelBuilder AddPannel(Func<AccordionPannelViewModelBuilder, AccordionPannelViewModelBuilder> pannel)
        {
            AccordionPannelViewModelBuilder builder = pannel(new AccordionPannelViewModelBuilder());
            AccordionViewModel.AccordionPannels.Add(builder.AccordionPannel);
            return this;
        }

        public AccordionViewModel Build()
        {
            return AccordionViewModel;
        }


        public AccordionViewModelBuilder CurrentOpenID(string CurrentOpenID)
        {
            AccordionViewModel.CurrentOpenID = CurrentOpenID;
            return this;
        }

    
    }
}